from flask import Flask, render_template, request, redirect, url_for

app = Flask(__name__)

@app.route('/')
def show_login():
    return render_template('login.html')

@app.route('/login', methods=['POST'])
def login():
    username = request.form['username']
    password = request.form['password']
    if username == 'admin' and password == '123456':
        return 'Logged in successfully'
    else:
        return 'Invalid username or password'

@app.route('/logout')
def logout():
    return redirect(url_for('show_login'))

if __name__ == '__main__':
    app.run(host='127.0.0.1', port=5000)